package yang.VirtualMachine.chapter11.asmTime;

import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassWriter;

import yang.VirtualMachine.chapter9.ClassUtil;

public class TimeStatWeaveGenerator {
	
	public static void main(String args[]) throws Exception {
		String className = Account.class.getName();
		ClassReader cr = new ClassReader(className);
		ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS | ClassWriter.COMPUTE_FRAMES);
		TimeStatClassAdater classAdapter = new TimeStatClassAdater(cw);
		cr.accept(classAdapter, ClassReader.SKIP_DEBUG);
		byte[] data = cw.toByteArray();
		ClassUtil.runClass(className, data, 0);
	}
	

}
